package com.zsl.swing.redis.desktop.pool;

import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

public class SchedulePoolUtils {

    private static ScheduledExecutorService schedule = Executors.newScheduledThreadPool(Runtime.getRuntime().availableProcessors() * 2);

    public static void schedule(Runnable r, long delay, long periods, TimeUnit unit){
        schedule.scheduleAtFixedRate(r,delay, periods, unit);
    }

}

